document.write("<script src=\"" + context
		+ "/system/role/js/rolelist.js\"></script>");
document.write("<script src=\"" + context
		+ "/system/role/js/roleadd.js\"></script>");
document.write("<script src=\"" + context
		+ "/system/role/js/roleedit.js\"></script>");

/**
 * 创建角色对象多数据返回值
 * 
 * @param {}
 *            ids
 * @param {}
 *            names
 * @param {}
 *            types
 * @param {}
 *            form
 */
function countRoleObjectItem(rid, ids, names, types, formpanel) {
	var idstr = ids.split(',');
	var namestr = names.split(',');
	var typestr = types.split(',');

	var countO = "";

	for (var i = 0; i < idstr.length; i++) {
		if (rid != null) {
			formpanel.add(new Ext.form.Hidden({
						name : 'rid_' + i,
						value : rid
					}));
		}

		formpanel.add(new Ext.form.Hidden({
					name : 'oid_' + i,
					value : idstr[i]
				}));
		formpanel.add(new Ext.form.Hidden({
					name : 'oname_' + i,
					value : namestr[i]
				}));
		formpanel.add(new Ext.form.Hidden({
					name : 'otype_' + i,
					value : typestr[i]
				}));

		if (i < idstr.length - 1) {
			countO += i + ",";
		} else {
			countO += i;
		}
	}

	formpanel.add(new Ext.form.Hidden({
				name : 'countO',
				value : countO
			}));

	formpanel.doLayout();
}